Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StyleTransfer infers the number of filters #1414

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

lindapaiste
Copy link
Contributor

Extends #1380

Closes #281

This PR removes some of the hard-coded values in StyleTransfer so that it can work with user-trained models which were trained using a different number of filters. Specifically, the Van Gogh models here.

We can derive the numFilters by looking at the shape of the filter variable. These shapes are specified in the manifest.json, but I'm just looking at the filter tensor directly.

The input does not need to be any particular size, so I am removing the IMAGE_SIZE and the Video base class which uses it. The resizing didn't work anyways! We still have issues with video loading in Safari, though I'm getting a different error than before.

I wonder if the strides is also something that's variable which we want to infer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Uncaught Error: error in conv2dDerInput: depth of input (64) must match input depth for filter32
1 participant